default['pgbouncer']['env_directory'] = '/opt/gitlab/etc/pgbouncer/env'
default['pgbouncer']['env'] = {
  'SSL_CERT_DIR' => "#{node['package']['install-dir']}/embedded/ssl/certs/"
}
default['pgbouncer']['enable'] = false
default['pgbouncer']['log_directory'] = '/var/log/gitlab/pgbouncer'
default['pgbouncer']['data_directory'] = '/var/opt/gitlab/pgbouncer'
default['pgbouncer']['listen_addr'] = '0.0.0.0'
default['pgbouncer']['listen_port'] = 6432
default['pgbouncer']['pool_mode'] = 'transaction'
default['pgbouncer']['server_reset_query'] = 'DISCARD ALL'
default['pgbouncer']['max_client_conn'] = 2048
default['pgbouncer']['application_name_add_host'] = 1
default['pgbouncer']['default_pool_size'] = 100
default['pgbouncer']['min_pool_size'] = 0
default['pgbouncer']['reserve_pool_size'] = 5
default['pgbouncer']['reserve_pool_timeout'] = '5.0'
default['pgbouncer']['server_round_robin'] = 0
default['pgbouncer']['log_connections'] = 0
default['pgbouncer']['server_idle_timeout'] = '30.0'
default['pgbouncer']['dns_max_ttl'] = '15.0'
default['pgbouncer']['dns_zone_check_period'] = 0
default['pgbouncer']['dns_nxdomain_ttl'] = '15.0'
default['pgbouncer']['admin_users'] = %w(gitlab-psql postgres pgbouncer)
default['pgbouncer']['stats_users'] = %w(gitlab-psql postgres pgbouncer)
default['pgbouncer']['ignore_startup_parameters'] = 'extra_float_digits'
default['pgbouncer']['databases_ini'] = '/var/opt/gitlab/pgbouncer/databases.ini'
default['pgbouncer']['databases_ini_user'] = 'root'
default['pgbouncer']['databases_json'] = '/var/opt/gitlab/pgbouncer/databases.json'
default['pgbouncer']['databases'] = {}
default['pgbouncer']['logfile'] = nil
default['pgbouncer']['unix_socket_dir'] = nil
default['pgbouncer']['unix_socket_mode'] = '0777'
default['pgbouncer']['unix_socket_group'] = nil

default['pgbouncer']['client_tls_sslmode'] = 'disable'
default['pgbouncer']['client_tls_ca_file'] = nil
default['pgbouncer']['client_tls_key_file'] = nil
default['pgbouncer']['client_tls_cert_file'] = nil
default['pgbouncer']['client_tls_protocols'] = 'all'
default['pgbouncer']['client_tls_dheparams'] = 'auto'
default['pgbouncer']['client_tls_ecdhcurve'] = 'auto'
default['pgbouncer']['server_tls_sslmode'] = 'disable'
default['pgbouncer']['server_tls_ca_file'] = nil
default['pgbouncer']['server_tls_key_file'] = nil
default['pgbouncer']['server_tls_cert_file'] = nil
default['pgbouncer']['server_tls_protocols'] = 'all'
default['pgbouncer']['server_tls_ciphers'] = 'fast'
default['pgbouncer']['server_reset_query_always'] = 0
default['pgbouncer']['server_check_query'] = 'select 1'
default['pgbouncer']['server_check_delay'] = 30
default['pgbouncer']['max_db_connections'] = nil
default['pgbouncer']['max_user_connections'] = nil
default['pgbouncer']['syslog'] = 0
default['pgbouncer']['syslog_facility'] = 'daemon'
default['pgbouncer']['syslog_ident'] = 'pgbouncer'
default['pgbouncer']['log_disconnections'] = 1
default['pgbouncer']['log_pooler_errors'] = 1
default['pgbouncer']['stats_period'] = 60
default['pgbouncer']['verbose'] = 0
default['pgbouncer']['server_lifetime'] = 3600
default['pgbouncer']['server_connect_timeout'] = 15
default['pgbouncer']['server_login_retry'] = 15
default['pgbouncer']['query_timeout'] = 0
default['pgbouncer']['query_wait_timeout'] = 120
default['pgbouncer']['client_idle_timeout'] = 0
default['pgbouncer']['client_login_timeout'] = 60
default['pgbouncer']['autodb_idle_timeout'] = 3600
default['pgbouncer']['suspend_timeout'] = 10
default['pgbouncer']['idle_transaction_timeout'] = 0
default['pgbouncer']['pkt_buf'] = 4096
default['pgbouncer']['listen_backlog'] = 128
default['pgbouncer']['sbuf_loopcnt'] = 5
default['pgbouncer']['max_packet_size'] = 2147483647
default['pgbouncer']['tcp_defer_accept'] = 0
default['pgbouncer']['tcp_socket_buffer'] = 0
default['pgbouncer']['tcp_keepalive'] = 1
default['pgbouncer']['tcp_keepcnt'] = 0
default['pgbouncer']['tcp_keepidle'] = 0
default['pgbouncer']['tcp_keepintvl'] = 0
default['pgbouncer']['disable_pqexec'] = 0

default['pgbouncer']['auth_type'] = 'md5'
default['pgbouncer']['auth_hba_file'] = nil
default['pgbouncer']['auth_query'] = 'SELECT username, password FROM public.pg_shadow_lookup($1)'
default['pgbouncer']['users'] = {}

# PostgreSQL accounts
default['postgresql']['pgbouncer_user'] = 'pgbouncer'
default['postgresql']['pgbouncer_user_password'] = nil
